﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Wild2.Models.Pages.Favorites.Index>" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Resources.Home.Title %>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HeaderBlockContent" runat="server">
<%--Keywords--%>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% Html.RenderPartial("~/Views/Shared/" + version + "/Header.ascx", "Уведомления"); %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <% if (!String.IsNullOrEmpty(Model.infoMessage))
       {
           Html.RenderPartial("~/Views/Shared/" + version + "/InfoBox.ascx", Model.infoMessage);
       } %>
       <div class="container">
        <% 
            Object fav = Session[Wild2.Models.Constants.SessionConstants.FAVORITES];
            if (fav != null)
            {

                Html.RenderPartial("~/Views/Shared/" + version + "/Panel.ascx", HttpUtility.HtmlEncode(fav.ToString().Split(new char[] { '|' })[0]) 
                    + "<br />" 
                    + Html.TextBox("fav", ConfigurationManager.AppSettings["domain"] 
                    + fav.ToString().Split(new char[] { '|' })[1])
                    + "<br />" 
                    + Html.ActionLink("Добавить в закладки", "Add")
                    );
            }
            foreach (var favorite in Model.Favorites)
	        {
                Html.RenderPartial("~/Views/Shared/" + version + "/Element.ascx", "<a href=\"" + favorite.Url + "\">" + HttpUtility.HtmlEncode(favorite.Name) + "</a> [" + Html.ActionLink("уд.", "Delete", new { id = favorite.ID }) + "]");
	        }
        %>
        </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FooterContent" runat="server">
    <%  String version = "pda"; if (Session[Wild2.Models.Constants.SessionConstants.VERSION] != null) version = Session[Wild2.Models.Constants.SessionConstants.VERSION].ToString(); %>
    <%  Html.RenderPartial("~/Views/Shared/" + version + "/Footer.ascx");
        %>
</asp:Content>